import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;


public class ReverseLineToFile {
	 public static void main(String[] args) throws IOException,FileNotFoundException  
	    {  
	        FileReader fr=new FileReader("C://origin.txt");  
	        BufferedReader br=new BufferedReader(fr);  
	        String s;  
	  
	        List<String> tmp = new ArrayList<String>(); 
	        while ((s=br.readLine())!=null){
	        	tmp.add(s);
	        }
	        br.close();
	        
	        FileWriter fw = new FileWriter("C://originReverse.txt");
	        BufferedWriter bw = new BufferedWriter(fw);

	        for(int i=tmp.size()-1;i>=0;i--) {  
	        	bw.write(tmp.get(i)+System.getProperty("line.separator"));  
	        }  
	        bw.close();
	    }  
}

/* Result
origin.txt

Original String
Sample String used to test with simple solution
Reverse String
solution simple with test to used String Sample 

originReverse.txt

solution simple with test to used String Sample 
Reverse String
Sample String used to test with simple solution
Original String

*/
